﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;

public partial class Experts : System.Web.UI.Page
{
	private PX.Expert.ExpertComponent clsExpertComp = new PX.Expert.ExpertComponent();

	protected void Page_Load(object sender, EventArgs e)
	{
		ShowExpertOne();
		ShowExpertTwo();
	}

	////////////////////////////////////////////////////////////////////////////////////////////////////
	/// <summary>
	/// 显示博士后专家
	/// </summary>
	private void ShowExpertOne()
	{
		List<PX.Expert.Expert> listExpertOne = new List<PX.Expert.Expert>();

		listExpertOne = clsExpertComp.QueryExpertOne();
		for (int i = 0; i < listExpertOne.Count; i++)
		{
			Label labExpertName = new Label();
			Literal lit1 = new Literal();
			Literal lit2 = new Literal();
			HyperLink hLink = new HyperLink();
			PX.Expert.Expert clsExpert = new PX.Expert.Expert();
			Literal litbr = new Literal();

			litbr.Text = "<br>";
			hLink.Target = "_parent";

			clsExpert = listExpertOne[i];
			labExpertName.Text = clsExpert.Name;
			pExpertOne.Controls.Add(labExpertName);

			lit1.Text = "[";
			pExpertOne.Controls.Add(lit1);

			if (clsExpert.OnLine == clsExpertComp._clsConfig.nExpertOnLine_Yes)
			{
				hLink.Text = "在线";
				hLink.NavigateUrl = "PlatFormQuestion.aspx?ExpertID=" + clsExpert.ID.ToString();
			}

			if (clsExpert.OnLine == clsExpertComp._clsConfig.nExpertOnLine_No)
			{
				hLink.Text = "离线";
			}
			pExpertOne.Controls.Add(hLink);

			lit2.Text = "]";

			pExpertOne.Controls.Add(lit2);

			if (i % 5 == 4)
			{
				pExpertOne.Controls.Add(litbr);
			}
		}
	}
	////////////////////////////////////////////////////////////////////////////////////////////////////

	////////////////////////////////////////////////////////////////////////////////////////////////////
	/// <summary>
	/// 显示技能大师专家
	/// </summary>
	private void ShowExpertTwo()
	{
		List<PX.Expert.Expert> listExpertOne = new List<PX.Expert.Expert>();

		listExpertOne = clsExpertComp.QueryExpertTwo();
		for (int i = 0; i < listExpertOne.Count; i++)
		{
			Label labExpertName = new Label();
			Literal lit1 = new Literal();
			Literal lit2 = new Literal();
			HyperLink hLink = new HyperLink();
			PX.Expert.Expert clsExpert = new PX.Expert.Expert();
			Literal litbr = new Literal();

			litbr.Text = "<br>";

			clsExpert = listExpertOne[i];
			labExpertName.Text = clsExpert.Name;
			pExpertTwo.Controls.Add(labExpertName);

			lit1.Text = "[";
			pExpertTwo.Controls.Add(lit1);

			if (clsExpert.OnLine == clsExpertComp._clsConfig.nExpertOnLine_Yes)
			{
				hLink.Text = "在线";
				hLink.NavigateUrl = "PlatFormQuestion.aspx?ExpertID=" + clsExpert.ID.ToString();
			}

			if (clsExpert.OnLine == clsExpertComp._clsConfig.nExpertOnLine_No)
			{
				hLink.Text = "离线";
			}
			pExpertTwo.Controls.Add(hLink);

			lit2.Text = "]";

			pExpertTwo.Controls.Add(lit2);

			if (i % 5 == 4)
			{
				pExpertTwo.Controls.Add(litbr);
			}
		}
	}
	////////////////////////////////////////////////////////////////////////////////////////////////////
}
